Python file closed when opened | How to fix it | Easy way